package cc.sunwl.strategy;

public class ContextAndSimplefactory {

    private Strategy strategy;

    public ContextAndSimplefactory(char type) {
        switch (type) {
        case 'A':
            this.strategy = new ConcreteStrategyA();
            break;
        case 'B':
            this.strategy = new ConcreteStrategyB();
            break;
        case 'C':
            this.strategy = new ConcreteStrategyC();
            break;
        default:
            break;
        }
    }

    /**
     * 上下文接口
     */
    public void ContextInterface() {
        strategy.algorithmInterface();
    }
}
